1. Field of the Invention
The present invention relates to the field of computer systems, in particular, multiprocessor computer systems. More specifically, the present invention relates to arbitrating multiprocessor accesses to shared resources, which has particular application to multiprocessor communication.
2. Background
Today, many computer systems comprise multiple processors. Typically, the processors share a number of resources, for example, an area in memory for inter-processor communication. For many of these multiprocessor systems, the processors access the shared resources through a common high speed bus. Arbitration function is provided to grant momentary exclusive ownership of the bus to a particular processor. For those multiprocessor systems having private cache memory in some of the processors, coherent data management function is also provided for accessing the shared resources. The arbitration and coherent data management functions are either provided in a centralized manner by the bus or in a decentralized manner by the processors.
Additionally, some form of semaphore is employed to control access to each of the shared resources. A semaphore is a mutual exclusion lock. A processor reads the semaphore and checks if the semaphore equals a predetermined value, for example, zero, to determine if a shared resource is currently free. If the shared resource is free, the processor takes temporary ownership of the shared resource and writes another predetermined value back for the semaphore, for example, a non-zero value, to indicate such temporal taking of ownership. If the shared resource is not free, the processor repeats the reading and checking until the semaphore contains the predetermined value indicating the shared resource is free. At the end of the access, the processor reset the semaphore to indicate the shared resource is free again. The semaphore management protocol also includes mechanism or rule that the semaphore is reset only by the last processor that took temporal ownership of the shared resource. To ensure the read-modify-write manipulation of a semaphore by a processor is uninterfered by other processor trying to gain temporal ownership of the shared resource, typically the bus provides atomic bus cycles by which the processor can gain temporal ownership of the bus for a number of uninterrupted contiguous bus cycles.
Traditional semaphore management has at least four disadvantages:
1) most semaphore management tend to prioritize processor accesses on a first come first serve basis, PA1 2) for those semaphore management that allow relative access priority settings, they generally do not provide a simple way for the contending processors to determine their own access priority level, or for the relative access priority to be changed dynamically, PA1 3) they generally do not provide a simple way for determining which processor is the current owner of a shared resource, PA1 4) they require all processors to be able to perform the read-modify write operations and the bus to support atomic bus cycles, furthermore, the read-modify-write operations are performed by the processors in like manner thereby excluding the possibility of incorporating heterogeneous processors in the same computer system.
As will be disclosed, the present invention provides a method and apparatus for arbitrating multiprocessor accesses to shared resources that overcomes the disadvantages of the prior art.